//
//  RegisterInputCodeVc.m
//  MJApp
//
//  Created by John on 15/5/12.
//  Copyright (c) 2015年 wangliang. All rights reserved.
//

#import "RegisterInputCodeVc.h"
#import "LogInInputPwdVc.h"

@interface RegisterInputCodeVc ()
{
    NSString * _phone;
}
@property (weak, nonatomic) IBOutlet UITextField *authorCodeText;

@end

@implementation RegisterInputCodeVc
- (id)initWithPhone:(NSString *)phone{

    if (self = [super init]) {
        _phone = phone;
    }
    return self;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (IBAction)nextToSetPwd:(UIButton *)sender {
    NSMutableDictionary * param = [NSMutableDictionary dictionary];
    param[@"code"] = self.authorCodeText.text;
    [WLHTTPRequest checkCodeWithParam:param usingSucessBlock:^(BOOL isSucess, NSDictionary *resultDictionary) {
//        NSLog(@"%@",resultDictionary);
        if ([[resultDictionary cusObjectForKey:@"status"] intValue]==1) {
            [self.navigationController pushViewController:[[LogInInputPwdVc alloc] initWithPhone:_phone] animated:YES];
        }else{
        
            [[DMCAlertCenter defaultCenter] postAlertWithMessage:[resultDictionary cusObjectForKey:@"msg"]];
        }
    } andFailureBlock:^(NSError *resultError) {
        
    }];
    
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
